<%@ page language="java" pageEncoding="us-ascii" contentType="text/html;charset=us-ascii" %>
<%--Copyright (C) 2011 Wolfgang Hankeln, Norma J. Wendel
	 
	This file is part of CDinFusion.
	
	CDinFusion is free software: you can redistribute it and/or
	modify it under the terms of the GNU Lesser General Public 
	License in version 3 (LGPL3) as published by the Free Software
	Foundation version 3 of the License.
	
	CDinFusion is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	Lesser General Public License for more details.
	
	You should have received a copy of the Lesser General Public
	License along with CDinFusion; see the file COPYING. If not,
	write to the Free Software Foundation, 59 Temple Place - Suite 330,
	Boston, MA 02111-1307, USA or see <http://www.gnu.org/licenses/>.
	
	If you have any questions, send an email to: megx@mpi-bremen.de.
--%>
<%@ page import="org.cdinfusion.data.*"%>
<%@ page import="org.cdinfusion.data.environment.*"%>
<%@ page import="org.cdinfusion.data.studytype.*"%>
<%@ page import="java.util.*"%>

<%
System.out.println("<<<<<<<<<<3_filled_env_input_fields>>>>>>>>>>");
//STUDYTYPE
Object obj2 = session.getAttribute("obj2");
String env = (String) session.getAttribute("env");
String[][] attributes = null;

	if (env.equals("none")){
		out.print("No environmental package has been selected.");
		%><input type="hidden" name="env_type" value="none"><%
	}
	if (env.equals("water")){
		Water water = (Water) obj2;
		attributes = GetInformation.filledFormInformation(water);
		%>
		<b> environmental package: water </b>
		<input type="hidden" name="env_type" value="water">
		<%	  
	}//end water

	if (env.equals("wastewater")){
		Wastewater wastewater = (Wastewater) obj2;
		attributes = GetInformation.filledFormInformation(wastewater);
		%>
		<b> environmental package: wastewater/sludge </b>
		<input type="hidden" name="env_type" value="wastewater">
		
		<%	  
	}//end wastewater

	if (env.equals("soil")){
		Soil soil = (Soil) obj2;
		attributes = GetInformation.filledFormInformation(soil);
		%>
		<b> environmental package: soil </b>
		<input type="hidden" name="env_type" value="soil">
		<%	  
	}//end soil

	if (env.equals("sediment")){
		Sediment sediment = (Sediment) obj2;
		attributes = GetInformation.filledFormInformation(sediment);
		%>
		<b> environmental package: sediment </b>
		<input type="hidden" name="env_type" value="sediment">
		<%	  
	}//end sediment

	if (env.equals("plant_associated")){
		Plant_associated plant_associated = (Plant_associated) obj2;
		attributes = GetInformation.filledFormInformation(plant_associated);
		%>
		<b> environmental package: plant-associated </b>
		<input type="hidden" name="env_type" value="plant_associated">
		<%	  
	}//end plant-associated

	if (env.equals("miscellaneous")){
		Miscellaneous miscellaneous = (Miscellaneous) obj2;
		attributes = GetInformation.filledFormInformation(miscellaneous);
		%>
		<b> environmental package: miscellaneous </b>
		<input type="hidden" name="env_type" value="miscellaneous">
		<%	  
	}//end miscellaneous

	if (env.equals("biofilm")){
		Biofilm biofilm = (Biofilm) obj2;
		attributes = GetInformation.filledFormInformation(biofilm);
		%>
		<b> environmental package: microbial mat/biofilm </b>
		<input type="hidden" name="env_type" value="biofilm">
		<%	  
	}//end biofilm

	if (env.equals("human_vaginal")){
		Human_vaginal human_vaginal = (Human_vaginal) obj2;
		attributes = GetInformation.filledFormInformation(human_vaginal);
		%>
		<b> environmental package: human-vaginal </b>
		<input type="hidden" name="env_type" value="human_vaginal">
		<%	  
	}//end human-vaginal

	if (env.equals("human_skin")){
		Human_skin human_skin = (Human_skin) obj2;
		attributes = GetInformation.filledFormInformation(human_skin);
		%>
		<b> environmental package: human-skin </b>
		<input type="hidden" name="env_type" value="human_skin">
		<%	  
	}//end human-skin

	if (env.equals("human_oral")){
		Human_oral human_oral = (Human_oral) obj2;
		attributes = GetInformation.filledFormInformation(human_oral);
		%>
		<b> environmental package: human-oral </b>
		<input type="hidden" name="env_type" value="human_oral">
		<%	  
	}//end human-oral

	if (env.equals("human_gut")){
		Human_gut human_gut = (Human_gut) obj2;
		attributes = GetInformation.filledFormInformation(human_gut);
		%>
		<b> environmental package: human-gut </b>
		<input type="hidden" name="env_type" value="human_gut">
		<%	  
	}//end human-gut

	if (env.equals("human_associated")){
		Human_associated human_associated = (Human_associated) obj2;
		attributes = GetInformation.filledFormInformation(human_associated);
		%>
		<b> environmental package: human-associated </b>
		<input type="hidden" name="env_type" value="human_associated">
		<%	  
	}//end human-associated

	if (env.equals("host_associated")){
		Host_associated host_associated = (Host_associated) obj2;
		attributes = GetInformation.filledFormInformation(host_associated);
		%>
		<b> environmental package: host-associated </b>
		<input type="hidden" name="env_type" value="host_associated">
		<%	  
	}// end host-associated 

	if (env.equals("air")){
		Air air = (Air) obj2;
		attributes = GetInformation.filledFormInformation(air);
		%>
		<b> environmental package: air </b>
		<input type="hidden" name="env_type" value="air">
		<%	  
	}//end air
	%>
	<table width="100%" border="0" bgcolor="#DCDCDC" cellpadding="1">
		<tr>
		<td align=left style="width:410px"><b><font size=2>parameter</font></b></td>
		<td style="min-width:206px"><b><font size=2></font></b></td>
		<td align=left><b><font size=2>value</font></b></td>
		</tr>
	<%
	try{
		for(int i = 0; i < attributes.length; i++){%>	
		<tr align=left style="width:250px"><td><b><font size=1><%=attributes[i][1].toString()%></font></b></td>
		<td align=left style="min-width:206px"><font size=1>
			<a href="popup_information.htm?item=<%=attributes[i][0].toString()%>" target="_blank" onclick="openpopup(this.href); return false"> more info </a>
		</font></td>
   		<td align=right><input type="text" name="<%=attributes[i][0].toString()%>" class="required parameter" size="25" value="<%=attributes[i][2].toString()%>"></td></tr>
   		<%}
	}catch(Exception e){
		System.out.println("ERROR in 3_filled_env.... "+e.toString()+" ... "+e.getLocalizedMessage());
	}
	%>
	</table>